package com.cccyy.data.list;

import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.Objects;

@Data
@AllArgsConstructor
public class UserForListTest {
    private int id;
    private String name;

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null || getClass() != obj.getClass()) {
            return false;
        }
        UserForListTest other = (UserForListTest) obj;
        return Objects.equals(id, other.id) && Objects.equals(name, other.name);
    }

    @Override
    public int hashCode() {
        // 通常推荐使用Objects.hash()方法来生成hashCode，它会处理null的情况
        return Objects.hash(id, name);
    }
}
